fix: print signature in codemap snippet terminal output#119
Conversation
Match codemap show: location, indented signature, then source body.
🦋 Changeset detectedLatest commit: 2fa5108 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughThe ChangesSnippet Signature Terminal Output
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/cli/cmd-snippet.ts (1)
200-224: ⚡ Quick winAdd public API docs for
renderSnippetTerminal.This function is exported, so it should have a concise JSDoc describing its output contract.
Proposed diff
+/** + * Render snippet matches in terminal order: location header, signature, then source. + * Emits stderr hints for disambiguation and stale snippets. + */ export function renderSnippetTerminal(result: SnippetResult): void {As per coding guidelines:
**/*.{ts,tsx,js,jsx}: All public APIs must have accompanying documentation.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/cli/cmd-snippet.ts` around lines 200 - 224, Add a concise JSDoc above the exported function renderSnippetTerminal(SnippetResult) describing its public API: explain that it prints snippet matches to stdout and disambiguation/staleness messages to stderr, describe the output format ("file_path:line_start-line_end" followed by signature and optional source) and side effects (prints blank line between matches, sets anyStale behavior), and document the parameter type (SnippetResult) and that the function returns void; include at least one short sentence about when stderr is used (disambiguation and stale notices).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/cli/cmd-snippet.ts`:
- Around line 200-224: Add a concise JSDoc above the exported function
renderSnippetTerminal(SnippetResult) describing its public API: explain that it
prints snippet matches to stdout and disambiguation/staleness messages to
stderr, describe the output format ("file_path:line_start-line_end" followed by
signature and optional source) and side effects (prints blank line between
matches, sets anyStale behavior), and document the parameter type
(SnippetResult) and that the function returns void; include at least one short
sentence about when stderr is used (disambiguation and stale notices).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9e29fc09-6d74-42e5-9fc0-811549a9f47f
📒 Files selected for processing (3)
.changeset/fix-snippet-terminal-signature.mdsrc/cli/cmd-snippet.test.tssrc/cli/cmd-snippet.ts
Summary
Terminal
codemap snippetdocumented location + signature + source but only printed location + source. Now matchescodemap show: indentedsignatureline before the source body.Test plan
renderSnippetTerminalunit testbun test src/cli/cmd-snippet.test.tsbun run typecheckSummary by CodeRabbit
Bug Fixes
codemap snippetcommand now displays symbol signature information in terminal output, consistent withcodemap showbehavior.Tests